

import { createSelector } from '@ngrx/store';

import { MapState, MeasureState } from '../reducers';
import { getMapState } from './map.selector';

const getMeasureState = createSelector(getMapState, (state: MapState) => state.measure);
const getMeasureDistance = createSelector(getMeasureState, (state: MeasureState) => state.distance);
const getMeasureAcreage = createSelector(getMeasureState, (state: MeasureState) => state.acreage);
const getMeasureClear = createSelector(getMeasureState, (state: MeasureState) => state.clear);

export const measureSelector = {
    getMeasureState,
    getMeasureDistance,
    getMeasureAcreage,
    getMeasureClear
};